package com.mdd.front.controller;

import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.front.service.IMenuService;
import com.mdd.front.validate.commons.PageValidate;
import com.mdd.front.validate.order.MenuSearchValidate;
import com.mdd.front.vo.order.MenuMealVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * 菜单控制层
 * @author shenjian
 * @createTime 2023年02月21日 23:15:00
 */

@RestController
@RequestMapping("api/order")
public class MenuController {

    @Resource
    IMenuService menuService;

    /**
     * 套餐列表
     *
     * @author shenjian
     * @param pageValidate 分页参数
     * @return AjaxResult<PageResult<MealVo>>
     */
    @GetMapping("/meal/list")
    public AjaxResult<PageResult<MenuMealVo>> list(@Validated PageValidate pageValidate) {
        PageResult<MenuMealVo> list = menuService.list(pageValidate);
        return AjaxResult.success(list);
    }
}
